package com.dt;


public class xx2 {
    public static void main(String[] args) {
        anm anms = new cat();
        anms.cry();
        anms=new dog();
        anms.cry();
    }
}
class anm{
    public void cry(){
        System.out.println("动物在叫");
    }
}
class cat extends anm{
    public void cry(){
        System.out.println("cat在叫");
    }
}
class dog extends anm{
    public void cry(){
        System.out.println("dog在叫");
    }
}